package com.loong.kmeans

/**
  * Created by 梁浩峰 on 2016/9/18 11:12.
  */
object ExceptionShow {
  def main(args: Array[String]): Unit = {
    dataSource()
  }

  def dataSource() = {
    (1 to 300 by 1).foreach { x =>
      if (x < 100) {
        print(x + "," + (random() + 2) + "," + (random() + 2) + " ")
      }
      else if (x < 200) {
        print(x + "," + (random() + 5) + "," + (random() + 5) + " ")
      }
      else {
        print(x + "," + (random() + 8) + "," + (random() + 8) + " ")
      }

      if (x%6 == 0) println

      //        println(x + "," + (random() + 6) + "," + (random() + 6))
    }
  }

  def random() = {
    val res = (math.random * 100).toInt.toFloat
    res / 100
  }
}
